package core.command
{
	import core.event.SocketEventID;
	import core.event.UnoEvent;
	import core.event.ViewEventID;

	public class UnoPunishCommand extends SuperCommand
	{
		public function UnoPunishCommand()
		{
			socketEvent = SocketEventID.UNO_PUNISH;
			viewEvent = ViewEventID.UNO_PUNISH;
		}
		
		override public function success(e:UnoEvent):void
		{
			//当前玩家的牌有座位信息
			var obj:Object = db.tableList[db.loginUser.table].config[e.data.seatID];
			
			var nKey:int = 0;
			for(var key:String in obj.cards)
			{
				nKey = Math.max(nKey, int(key));
			}
			
			for(var i:int = 0; i<e.data.card.length; i++)
			{
				obj[++nKey] = e.data.card[i];
			}
		}
	}
}